package top.archiesean.id.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import top.archiesean.common.core.constant.ServiceNameConstants;

import java.util.List;

/**
 * @author ArchieSean
 * @description feign接口
 * @date 2024-01-13 23:11
 */
@FeignClient(contextId = "IdFeign", name = ServiceNameConstants.ID_SERVICE, path = "/id")
public interface IdFeign {

    /**
     * id生成服务
     *
     * @return id
     */
    @GetMapping
    Long getId();

    /**
     * 批量生成id
     *
     * @param num 个数
     * @return set
     */
    @GetMapping("/{num}")
    List<Long> getId(@PathVariable(name = "num") int num);
}
